package com.h2cloud;

import java.util.Arrays;

/**
 * @author: wulongkai
 * @create: 2022-11-02 23:43
 **/
public class student {
    final String dept = "部门";
    String name;
    Integer age;

    public String getName() {
        return name;
    }

    public String getDept() {
        return dept;
    }

//    public void setDept(String dept) {
////        this.dept = dept;
//    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public static void main(String[] args) throws Exception {
//        student p = new student();
//        p.setName("longkai");
//        p.setAge(21);
//
////        Method method = student.class.getDeclaredMethod("setDept");
////        Object invoke = method.invoke(p);
////        System.out.println("invoke = " + invoke);
//
//        Field deptField = student.class.getDeclaredField("dept");
//        PropertyDescriptor propertyDescriptor = BeanUtils.getPropertyDescriptor(student.class, deptField.getName());
//        System.out.println("propertyDescriptor = " + propertyDescriptor);
//        System.out.println("propertyDescriptor.getWriteMethod() = " + propertyDescriptor.getWriteMethod());

//        Long s;
//        System.out.println("StringUtils.isEmpty(s) = " + StringUtils.isEmpty(s));
//        boolean equals = "".equals(s);
//        System.out.println("equals = " + equals);

//        String esignRuleId = ",,";
//        String[] ruleIds = esignRuleId.split(",");
//        String[] ruleIds2 = {"1587700598562623488", "124", "0", "012", "-12"};
//        for (String id : ruleIds2) {
//            System.out.println(Pattern.matches("^[1-9]\\d*$", id));
//        }
//        List<String> list = Arrays.stream(ruleIds2)
//                .filter(s -> !(s == null || s.trim().isEmpty()))
//                .collect(Collectors.toList());
//        System.out.println("String.join(\",\", list) = " + String.join(",", list));

//        String[] esignRuleId2 = {"1323", "134", "344", "243"};
//        String join = String.join(",", esignRuleId2);
//        System.out.println(join);
//
//        String ss = " ";
//        ss.split(",");
//
//        // 初始化 Date 对象
//        Date date = new Date();
//
//        // 使用 toString() 函数显示日期时间
//        System.out.println(date.toString());
//        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
//        System.out.println("Long.valueOf(sdf.format(date)) = " + Long.valueOf(sdf.format(date)));


        String s1 = ",,1587700598562623488,1587700704061952000,1587700799704666112,,";
        String[] split = s1.split(",");
        System.out.println("split.length = " + split.length);
        System.out.println("Arrays.toString(split) = " + Arrays.toString(split));

        String s2 = ",1587700598562623488,1587700704061952000,1587700799704666112";
        String[] split2 = s2.split(",");
        System.out.println("split2.length = " + split2.length);

        String s3 = ",";
        String[] split3 = s3.split(",");
        System.out.println("split2.length = " + split3.length);

        System.out.println(Arrays.toString("m.g.h.i.o".split(".")));
        System.out.println(Arrays.toString("m|g|h|i|o".split("|")));

        System.out.println(Arrays.toString("m.g.h.i.o".split("\\.")));
        System.out.println(Arrays.toString("m|g|h|i|o".split("\\|")));
    }

}